import React, { Component } from 'react'

export default class App extends Component {
	state = {
		count: 0
	}

	handelClick = (e) => {
		// 实例方法
		console.log(this.state.count)
	}
	render() {
		return (
			<div style={{ textAlign: 'center' }}>
				<h2>计数器:{this.state.count}</h2>
				<button onClick={this.handelClick}>+1</button>
			</div>
		)
	}
}
